<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login</title>
</head>
<body>
<button id="registe">用户注册</button>
<br>
<h3><a href="./user">用户登录</a></h3>
</body>
<script src="resources/js/jquery.min.js"></script>
<script src="resources/js/matrix.login.js"></script>
<script src="resources/js/jquery.gritter.min.js"></script>
<script src="resources/js/vue.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	
	$("#vertifycode").click(vertifycode);
	$("#registe").click(registe);
	$("#login").click(login);
});


function vertifycode(){
	$.ajax("./sms/send/code", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"phone":"18968383532"}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}


function registe(){
	$.ajax("./common/login/registe", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"username":"anson","phone":"17855833078","password":"123","userType":"admin"}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}

function login(){
	$.ajax("./common/login/sign/in", 
			{
			dataType : "json", 
   			type : "post", 
		   contentType:"application/json", 
		   data:JSON.stringify({"phone":"17855833076","password":"123","remember":true}),
		   success :function(data){
			   console.log(data);
		   },
		   error:function(){
			   alert("数据发送失败");
		   }
	});
}
</script>
</html>